public class Main {
    public static void main(String[] args) {
        obj obj1 = new obj();
        obj1.addData();
        System.out.println();
        System.out.println(obj1.head.data);
    }
}

class obj{
    obj head;
    obj next;
    int data;

    void addData(){
        obj temp = head;
        temp.data = 6;
    }
}
